﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace onPulse01
{
    public partial class SettingsAccount : PhoneApplicationPage
    {
        private AppSettings settings = new AppSettings();
        
        public SettingsAccount()
        {
            InitializeComponent();

            //ApplicationBar = new ApplicationBar();
            //ApplicationBar.IsMenuEnabled = true;
            //ApplicationBar.IsVisible = true;
            //ApplicationBar.Opacity = 1.0;

            //ApplicationBarIconButton doneButton = new ApplicationBarIconButton(new Uri("/icons/appbar.check.rest.png", UriKind.Relative));
            //doneButton.Text = "zapisz";
            //doneButton.Click += new EventHandler(doneButton_Click);

            //ApplicationBarIconButton cancelButton = new ApplicationBarIconButton(new Uri("/icons/appbar.cancel.rest.png", UriKind.Relative));
            //cancelButton.Text = "anuluj";
            //cancelButton.Click += new EventHandler(cancelButton_Click);

            //ApplicationBar.Buttons.Add(doneButton);
            //ApplicationBar.Buttons.Add(cancelButton);

            email.Text = settings.Email;
            pass.Password = settings.Password;
        }

        void doneButton_Click(object sender, EventArgs e)
        {
            settings.Email = email.Text;
            settings.Password = pass.Password;          
        }

        void cancelButton_Click(object sender, EventArgs e)
        {
            NavigationService.GoBack();
        }        
    }
}